package com.ctshk.rpc.user.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * <p>
 *  发送验证码
 * </p>
 *
 * @author 李新科
 * @date 2021/4/21 19:58
 */
@Data
@ApiModel
public class SmsReq implements Serializable {

    @NotBlank(message = "請選擇區號")
    @ApiModelProperty(name="contactMobileAreaCode", value = "聯繫人手機區號", required = true)
    private String contactMobileAreaCode;

    @NotBlank(message = "請輸入聯絡電話")
    @Pattern(regexp = "^[0-9]{8,11}$", message = "手机号必须是纯数字,并且是8到11位")
    @ApiModelProperty(name = "contactNumber", value = "聯絡電話", required = true)
    private String contactNumber;

    /**
     * 獲取區號+手機號
     * @return
     */
    public String getFullContactNumber() {
        return contactMobileAreaCode + contactNumber;
    }
}
